#include "IPList.h"

std::string zero_addr ("0.0.0.0");
std::string broadcast_addr ("255.255.255.255");

bool IPList::isIP ( const std::string& addr_ip )
{
	if (!addr_ip.compare(zero_addr)) return false;
	if (!addr_ip.compare(broadcast_addr)) return false;

	return true;
}

IPList::IPList(  )
{	}

void IPList::push_back ( const std::string& addr )
{
	if (isIP(addr))
		std::vector<std::string>::push_back(addr);
}


std::ostream& operator <<(std::ostream& stream, const IPList& iplist)
{
	for (
		std::vector<std::string>::const_iterator it = iplist.begin(); 
		it != iplist.end();
		++it
		)
		stream << *it << std::endl;

	stream << std::endl;

	
    return stream; 
}

